import * as types from './mutation-types'

const mutations = {
  // [方法名](参数1,参数2...){方法}
  [types.SET_OPEN_ID] (state, v) {
    state.openId = v
  },
  [types.SET_TOKEN] (state, v) {
    wx.setStorageSync('token', v)
    state.token = v
  },
  [types.SET_LUCK] (state, v) {
    state.luck = v
  },
  [types.SET_LUCKDETAIL] (state, v) {
    state.luckdetail = Object.assign({}, state.luckdetail, v)
  },
  [types.SET_GUESS] (state, v) {
    state.guess = Object.assign({}, state.guess, v)
  },
  [types.SET_MYLUCK] (state, v) {
    state.myluck = Object.assign({}, state.myluck, v)
  },
  [types.SET_MYGUESS] (state, v) {
    state.myguess = Object.assign({}, state.myguess, v)
  }
}

export default mutations
